package com.lds.erp.base;

import com.dph.common.utils.service.Base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author hongsir
 * @apiNote 自定义的json结果集
 * @date 2018/9/29 上午8:52
 */
@ApiModel(description = "返回实体")
public class JsonResult<T> extends Base {
    private static final long serialVersionUID = 5023859084244896779L;
    @ApiModelProperty(name = "success", value = "业务处理成功标识,true成功,false失败")
    private Boolean success = Boolean.FALSE;
    @ApiModelProperty(name = "code", value = "返回码(1成功,0失败,201强制修改密码,202权限不足,401未登录,402小程序token重新赋值),其他具体业务具体分析")
    private String code;
    @ApiModelProperty(name = "message", value = "返回信息提示")
    private String message;
    @ApiModelProperty(name = "data", value = "返回详情数据")
    private T data;

    public JsonResult(boolean success, String code, String message, T data) {
        this.success = success;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public JsonResult() {
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
